///////////////////////////////modify by vtwo
#ifndef LAZY_FLAGS_H
#define LAZY_FLAGS_H

#define IA32_INSTR_ADD8           1
#define IA32_INSTR_ADD16          2
#define IA32_INSTR_ADD32          3

#define IA32_INSTR_SUB8           5
#define IA32_INSTR_SUB16          6
#define IA32_INSTR_SUB32          7

// used only if CF = 1 when executing ADC instruction
#define IA32_INSTR_ADC8           9
#define IA32_INSTR_ADC16          10
#define IA32_INSTR_ADC32          11

// used only if CF = 1 when executing SBB instruction
#define IA32_INSTR_SBB8           13
#define IA32_INSTR_SBB16          14
#define IA32_INSTR_SBB32          15

#define IA32_INSTR_INC8           17
#define IA32_INSTR_INC16          18
#define IA32_INSTR_INC32          19

#define IA32_INSTR_DEC8           21
#define IA32_INSTR_DEC16          22
#define IA32_INSTR_DEC32          23

#define IA32_INSTR_NEG8           25
#define IA32_INSTR_NEG16          26
#define IA32_INSTR_NEG32          27

#define IA32_INSTR_LOGIC8         29
#define IA32_INSTR_LOGIC16        30
#define IA32_INSTR_LOGIC32        31

//      BX_INSTR_BITSCAN8       not exists, leave number for alignment
#define IA32_INSTR_BITSCAN16      34
#define IA32_INSTR_BITSCAN32      35

#define IA32_INSTR_SHL8           37
#define IA32_INSTR_SHL16          38
#define IA32_INSTR_SHL32          39

#define IA32_INSTR_SHR8           41
#define IA32_INSTR_SHR16          42
#define IA32_INSTR_SHR32          43

#define IA32_INSTR_SAR8           45
#define IA32_INSTR_SAR16          46
#define IA32_INSTR_SAR32          47

#define IA32_INSTR_MUL8           49
#define IA32_INSTR_MUL16          50
#define IA32_INSTR_MUL32          51

#define IA32_INSTR_IMUL8          53
#define IA32_INSTR_IMUL16         54
#define IA32_INSTR_IMUL32         55

#define IA32_INSTR_COMPARE8       IA32_INSTR_SUB8
#define IA32_INSTR_COMPARE16      IA32_INSTR_SUB16
#define IA32_INSTR_COMPARE32      IA32_INSTR_SUB32


#define IA32_LF_INDEX_OSZAPC  1
#define IA32_LF_INDEX_OSZAP   2

#define IA32_LF_MASK_OSZAPC 0x111111
#define IA32_LF_MASK_OSZAP  0x222220

typedef struct 
{
  Bit8u op1_8;
  Bit8u op2_8;
  Bit8u result_8;

  Bit16u op1_16;
  Bit16u op2_16;
  Bit16u result_16;

  Bit32u op1_32;
  Bit32u op2_32;
  Bit32u result_32;

  unsigned instr;
} ia32_lf_flags_entry;

#endif
